package dao.impl;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import module.Employees;
import dao.ABSBasicDAO;
import domain.vo.queryObject;

public class EmployeesDAOImpl  extends ABSBasicDAO<Employees>{
	/**
	 * 员工DAO 实现类
	 * @param sqlMapClient
	 */
	public EmployeesDAOImpl(SqlMapClient sqlMapClient) {
		super(sqlMapClient);
	}
	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getAll()
	 */
	@Override
	public List<Employees> getAll() throws SQLException {
		// TODO Auto-generated method stub
		return sqlMapClient.queryForList("Employees.getAll");
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getById(java.lang.String)
	 */
	@Override
	public Employees getById(String id) throws SQLException {
		// TODO Auto-generated method stub
		return (Employees)sqlMapClient.queryForObject("Employees.getById",id);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getByPK()
	 */
	@Override
	public Employees getByPK() {
		// TODO Auto-generated method stub
		return super.getByPK();
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#insertT(java.lang.Object)
	 */
	@Override
	public void insertT(Employees t) throws SQLException {
		sqlMapClient.insert("Employees.insertEmployeesInfo", t);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#updateT(java.lang.Object)
	 */
	@Override
	public void updateT(Employees t) throws SQLException {
		sqlMapClient.update("Employees.updateEmployeesInfo", t);
	}
	
	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getObjectByQueryObject(domain.vo.queryObject)
	 */
	@Override
	public List<Employees> getObjectByQueryObject(queryObject queryObject) throws SQLException  {
		// TODO Auto-generated method stub
		return (List<Employees>)sqlMapClient.queryForList("Employees.getObjectByQueryObject", queryObject);
	}
	
	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#countByQueryObject(domain.vo.queryObject)
	 */
	@Override
	public int countByQueryObject(queryObject queryObject) throws SQLException {
		return (Integer)sqlMapClient.queryForObject("Employees.countByQueryObject", queryObject);
	}

}
